package com.cube.dp.base.error;

/**
 * @author cube.li
 * @date 2021/12/5 16:12
 * <p>
 * 通用的接口响应结果枚举类
 */
public enum CommonApiResultCode implements ApiResultCode {

    SUCCESS(0, "成功"),
    BLACK_IP(-2, "黑名单ip,禁止访问"),
    SYSTEM_ERROR(-1, "系统异常"),
    OPERATE_FAILED(1, "操作失败"),
    NULL_POINT(2, "空指针");
    private final Integer code;

    private final String msg;


    CommonApiResultCode(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    @Override
    public int getCode() {
        return this.code;
    }

    @Override
    public String getMsg() {
        return this.msg;
    }
}
